import { useTable, LIST_TYPE } from '@crud/index';
import { getOrderList as getList } from '@/api/crm-kgj/commune';

export const useTableList = (options: any = {}) => {
  const columns = [
    {
      label: '订单号',
      prop: 'trade_no',
      align: 'center',
      width: 200,
      showOverflowTooltip: true
    },
    {
      label: '用户名称',
      prop: 'nick_name',
      width: 200,
      showOverflowTooltip: true,
      align: 'left'
    },
    {
      label: '购买类型',
      prop: 'subject',
      align: 'center',
      minWidth: 140
    },
    {
      label: '支付金额',
      prop: 'total_fee',
      align: 'center',
      render: (s) => `￥${s.row.total_fee}`,
      width: 150
    },
    {
      label: '充值方式',
      prop: 'terminal_type',
      align: 'center'
    },
    {
      label: '支付方式',
      prop: 'trade_type',
      align: 'center'
    },
    {
      label: '支付时间',
      prop: 'complete_time',
      type: 'dateTime',
      align: 'center',
      width: 177
    },
    {
      label: '订单备注',
      prop: 'remark',
      showOverflowTooltip: true,
      width: 200,
      align: 'center'
    }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.KGJ,
    params: {},
    columns,
    getList
  });
};
